package com.manager.common.token;

public class TokenUtils {

    private static ThreadLocal<String> local = new ThreadLocal<>();

    public static String getCurrentToken(){
        return local.get();
    }

    public static void set(String token){
        local.set(token);
    }

    public static void remove(){
        local.remove();
    }

    public static boolean isLogin(){
        return TokenManager.getInstance().isLogin();
    }
    public static void loginOut(){
        TokenManager.getInstance().logout(local.get());
    }

    public static <T> T getLoginUser(){
        return TokenManager.getInstance().get(local.get());
    }
}
